package com.shusl.controller;

import com.shusl.service.AsyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AsyncController {

    @Autowired
    AsyncService asyncService;
    //告诉Spring这是一个异步方法

    @GetMapping("/hello")
    @Async
    public String hello(){
        asyncService.hello();
        return "success";
    }



}